<?php class Eventstravelships { 

    /***
     * DB Fields: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $id;

    /***
     * DB Fields: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $EventName;

    /***
     * DB Fields: shipType
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $shipType;

    /***
     * DB Fields: shipNumber
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $shipNumber;

    /***
     * DB Fields: shipSpeed
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $shipSpeed;

    /***
     * DB Fields: shipCargo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $shipCargo;

    /***
     * DB Fields: shipFuel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     **/
    var $shipFuel;

//--------------- GET METHODS ----------------------------- //
    /***
     * Get value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result id
     **/
    function get_id( ) {
        // returns the value of id
        return $this->id;
    }


    /***
     * Get value for field: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result EventName
     **/
    function get_EventName( ) {
        // returns the value of EventName
        return $this->EventName;
    }


    /***
     * Get value for field: shipType
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result shipType
     **/
    function get_shipType( ) {
        // returns the value of shipType
        return $this->shipType;
    }


    /***
     * Get value for field: shipNumber
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result shipNumber
     **/
    function get_shipNumber( ) {
        // returns the value of shipNumber
        return $this->shipNumber;
    }


    /***
     * Get value for field: shipSpeed
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result shipSpeed
     **/
    function get_shipSpeed( ) {
        // returns the value of shipSpeed
        return $this->shipSpeed;
    }


    /***
     * Get value for field: shipCargo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result shipCargo
     **/
    function get_shipCargo( ) {
        // returns the value of shipCargo
        return $this->shipCargo;
    }


    /***
     * Get value for field: shipFuel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @result shipFuel
     **/
    function get_shipFuel( ) {
        // returns the value of shipFuel
        return $this->shipFuel;
    }


//--------------- SET METHODS ----------------------------- //
    /***
     * Set value for field: id
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function set_id( $id ) {
        // sets the value of id
        $this->id = $id;
    }

    /***
     * Set value for field: EventName
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param EventName
     * @result void
     **/
    function set_EventName( $EventName ) {
        // sets the value of EventName
        $this->EventName = $EventName;
    }

    /***
     * Set value for field: shipType
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param shipType
     * @result void
     **/
    function set_shipType( $shipType ) {
        // sets the value of shipType
        $this->shipType = $shipType;
    }

    /***
     * Set value for field: shipNumber
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param shipNumber
     * @result void
     **/
    function set_shipNumber( $shipNumber ) {
        // sets the value of shipNumber
        $this->shipNumber = $shipNumber;
    }

    /***
     * Set value for field: shipSpeed
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param shipSpeed
     * @result void
     **/
    function set_shipSpeed( $shipSpeed ) {
        // sets the value of shipSpeed
        $this->shipSpeed = $shipSpeed;
    }

    /***
     * Set value for field: shipCargo
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param shipCargo
     * @result void
     **/
    function set_shipCargo( $shipCargo ) {
        // sets the value of shipCargo
        $this->shipCargo = $shipCargo;
    }

    /***
     * Set value for field: shipFuel
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param shipFuel
     * @result void
     **/
    function set_shipFuel( $shipFuel ) {
        // sets the value of shipFuel
        $this->shipFuel = $shipFuel;
    }

//--------------- CRUD METHODS ----------------------------- //
    /***
     * Create a new Record: eventstravelships
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param EventName
     * @param shipType
     * @param shipNumber
     * @param shipSpeed
     * @param shipCargo
     * @param shipFuel
     * @result void
     **/
    function createnew_eventstravelships( $id, $EventName, $shipType, $shipNumber, $shipSpeed, $shipCargo, $shipFuel ) {

        // items to be inserted in the database 
        $_obj = array($id,
                      $EventName,
                      $shipType,
                      $shipNumber,
                      $shipSpeed,
                      $shipCargo,
                      $shipFuel); 

        // database object connection
        $dbConn = $GLOBALS['dbConn'];

        // perform insert in the database
        $dbConn->insert("eventstravelships", $_obj);
    }

    /***
     * Retrived an existing record: eventstravelships
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result new Eventstravelships
     **/
    function get_eventstravelships( $id ) {

        // retrive the data
        $dbConn = $GLOBALS['dbConn'];

        // retrieved value in the database
        $_resultSet = $dbConn->doQuery("SELECT * FROM eventstravelships WHERE id = '$id'");

        $__eventstravelshipsObj = new eventstravelships();
        // return the retrived from the database

        // create a new object
        $__obj = new Eventstravelships();
        $__obj->set_id($_resultSet[0]['id']);
        $__obj->set_EventName($_resultSet[0]['EventName']);
        $__obj->set_shipType($_resultSet[0]['shipType']);
        $__obj->set_shipNumber($_resultSet[0]['shipNumber']);
        $__obj->set_shipSpeed($_resultSet[0]['shipSpeed']);
        $__obj->set_shipCargo($_resultSet[0]['shipCargo']);
        $__obj->set_shipFuel($_resultSet[0]['shipFuel']);


        return $__obj;
    }

    /***
     * Update an existing record: eventstravelships
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @param itemsToBeUpdated = array()
     * @result void
     **/
    function update_eventstravelships( $id, $itemsToBeUpdated = array() ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs update in the database
         foreach($itemsToBeUpdated as $_fName => $_fVal) { 
               $dbConn->addValuePair($_fName, $_fVal);
         }

         // perform update operation
         $dbConn->update("eventstravelships", "id = '$id'");
    }

    /***
     * Delete an existing record: eventstravelships
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param id
     * @result void
     **/
    function delete_eventstravelships( $id ) {

         // get database connection
         $dbConn = $GLOBALS['dbConn'];

         // performs deletion of data
         $dbConn->delete("eventstravelships", "id = '$id'");
    }

    /***
     * Retrived list of objects base on a given parameters: eventstravelships
     *
     *
     * THIS IS a generated method using the DBClassGenerator 
     * created by John paul de Guzman <jpdguzman@gmail.com> 
     *
     * @param conditionalStatement = ''
     * @result collection of objects: Eventstravelships
     **/
    function list_eventstravelships( $conditionalStatement = '' ) {

         $dbConn = $GLOBALS['dbConn'];
         // check if there is a given parameter list
         if(!empty($conditionalStatement)) { 
              $sqlStatement = "SELECT * FROM eventstravelships WHERE $conditionalStatement"; 
         } else { 
              $sqlStatement = "SELECT * FROM eventstravelships";
         }

         // retrieve the values base on the query result
         $__resObj = $dbConn->doQuery($sqlStatement);

         $__collectionOfObjects = array();
         foreach($__resObj as $__rs) { 
            $__newObj = new Eventstravelships();

            $__newObj->set_id($__rs['id']);
            $__newObj->set_EventName($__rs['EventName']);
            $__newObj->set_shipType($__rs['shipType']);
            $__newObj->set_shipNumber($__rs['shipNumber']);
            $__newObj->set_shipSpeed($__rs['shipSpeed']);
            $__newObj->set_shipCargo($__rs['shipCargo']);
            $__newObj->set_shipFuel($__rs['shipFuel']);

            // add object to collection 
            array_push($__collectionOfObjects, $__newObj);
         }

         // return collection of objects
         return $__collectionOfObjects;
    }

} ?>